hdSW = load('Stokes_Wave_n2048_c105.dat');
ders = load('derivatives_at_pi.dat');
nd = length(ders)-20;
c(1:nd) = ders(1:nd,1)+1i*ders(1:nd,2);

u = hdSW(:,1); rsw = hdSW(:,2); isw = hdSW(:,3);
%plot(u+rsw,isw)

x = u-pi; T = 0.*x;
for j = 1:nd
T = T + c(j)*x.^(j-1);
end

m=6
[r,a,b,mu,nu,poles,residues] = padeapprox(c,m,nd-m);

plot(u,real(rsw),u,real(T),u,real(r(x)))
axis([0 2*pi -0.5 0.5])

%plot(u,[rsw isw])